package org.tongdao.yulong.withanno;

import org.springframework.beans.factory.ObjectProvider;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @Description: TODO
 * @author: 殷玉龙
 * @date: 2021年01月11日 下午3:46
 */
public class LazyLookUpApplication {
  public static void main(String[] args) {
    ApplicationContext ctx = new ClassPathXmlApplicationContext("basic_dl/quickstart-lazylookup.xml");
    Cat cat = ctx.getBean(Cat.class);
    ObjectProvider<Dog> beanProvider = ctx.getBeanProvider(Dog.class);
    Dog ifAvailable = beanProvider.getIfAvailable(Dog::new);
  }
}
